USE [BMIG_MENSUAL_POST_CADENA]

 -- creating the store procedure
IF EXISTS (SELECT name 
	   FROM   sysobjects 
	   WHERE  name = 'WASP_M0007_DROP_CREATE'
	   AND 	  type = 'P') 
	DROP PROCEDURE [dbo].[WASP_M0007_DROP_CREATE]
GO
create PROCEDURE [dbo].[WASP_M0007_DROP_CREATE] AS
begin
  if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[AS_cabecera_produccion_UF_ant]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  begin
  	drop table [dbo].[AS_cabecera_produccion_UF_ant]
  end
  begin
    SELECT * 
    INTO dbo.AS_cabecera_produccion_UF_ant
    FROM dbo.cabecera_produccion_cabecera_ant
  end
	
	
End  